package com.qf.enums;

public enum AppHttpCodeEnum {
    // 成功
    SUCCESS(200, "操作成功"),
    // 登录
    NEED_LOGIN(401, "需要登录后操作"),
    NO_OPERATOR_AUTH(403, "无权限操作"),
    SYSTEM_ERROR(500, "出现错误"),
    REQUIRE_USERNAME(501, "必需填写用户名"),
    USERNAME_NOT_NULL(502, "用户名不能为空"),
    NICKNAME_NOT_NULL(503, "昵称不能为空"),
    PASSWORD_NOT_NULL(504, "密码不能为空"),
    EMAIL_NOT_NULL(505, "邮箱不能为空"),
    USERNAME_EXIST(506, "用户名已存在"),
    NICKNAME_EXIST(507, "昵称已存在"),
    PHONENUMBER_EXIST(508, "手机号已存在"),
    EMAIL_EXIST(509, "邮箱已存在"),
    LOGIN_ERROR(510, "用户名或密码错误"),
    CONTENT_NOT_NULL(511, "评论不能为空"),
    FILE_TYPE_ERROR(512, "文件类型错误,请上传图片格式文件"),
    UPDATE_ERROR(513, "更新失败"),
    DELETE_ERROR(514, "删除失败"),
    INSERT_ERROR(514, "新增失败"),
    PARAM_ERROR(515, "提交参数错误"),
    ID_ERROR(516, "该id不存在"),
    HOUSE_ERROR(517, "有业主的房屋不能删除");

    int code;
    String msg;

    AppHttpCodeEnum(int code, String errorMessage) {
        this.code = code;
        this.msg = errorMessage;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
